//for ZBrush 4R6 and above
 [VarDef,choice,0]    
[RoutineDef,DoIt,//start of routine
[IPress,Tool:Display Properties:Double]
]//end of routine

[IButton,???,"All Double Sided",
   [IShowActions,0]
   [IConfig,4.6]
[VarSet,choice,[MessageYesNo,"Run on one or all? Yes for all, No for just one","Do you wish to run the sample?"]]//this worked
[If,choice=1,
[IFreeze,
  [If,[IExists,Tool:SubTool:SelectDown],
   //store active subtool
   [VarSet,activeSubTool,[SubToolGetActiveIndex]]
   //loop through all subtools
   [Loop,[SubToolGetCount],	
    [SubToolSelect,[Var,n]]	   
     [RoutineCall,DoIt] //calls the routine for what we want to do      	
   ,n]//end loop
   //reselect active subtool
    [SubToolSelect,activeSubTool]
	]//end if,
	]//end freeze
[IPress,Transform:Xpose]
[IPress,Transform:Fit]
,
[RoutineCall,DoIt]
[IPress,Transform:Fit]
]//end if
]//end of macro button
